Modify Filter

Hello,
I like to modify a complex filter. e.g. to change a OR to a AND.
Only the complete Filter is stored with a view, so I have to redefine the complete filter.

I can get via stringOf(module, filter) the filter string.
When I modify this string is it possible to reapply this string to a filter definition?

Regards,

Randi
JL8713 - Wed Feb 17 12:33:44 EST 2010

Re: Modify Filter
doors36677 - Wed Feb 17 12:38:48 EST 2010

On the old forum there was some dxl that would convert the string to a DXL filter 'sometimes' but failed on complex filters. But it is probably easier to just redefine the filter.

Re: Modify Filter
JL8713 - Thu Feb 18 03:54:10 EST 2010

Hi, thanks for the fast reply.
I assume that the 'old forum' is not available any more to have a look at this dxl.

Re: Modify Filter
doors36677 - Thu Feb 18 07:37:06 EST 2010

JL8713 - Thu Feb 18 03:54:10 EST 2010
Hi, thanks for the fast reply.
I assume that the 'old forum' is not available any more to have a look at this dxl.

The old forum is downloadable and the link is either on the forum or the general forum

Re: Modify Filter
doors36677 - Thu Feb 18 07:58:29 EST 2010

doors36677 - Thu Feb 18 07:37:06 EST 2010
The old forum is downloadable and the link is either on the forum or the general forum

Look here: http://www.ibm.com/developerworks/forums/thread.jspa?threadID=275968&tstart=0

Re: Modify Filter
SystemAdmin - Thu Feb 18 17:52:39 EST 2010

JL8713 - Thu Feb 18 03:54:10 EST 2010
Hi, thanks for the fast reply.
I assume that the 'old forum' is not available any more to have a look at this dxl.

Checked to see if the FTP access to the archives of the Telelogic forums was still available, looks like it's been removed.

I have a copy and looked this up - the attached zip file has a PDF of the thread and a copy of the DXL files discussed in that thread. I hope you can make sense of it.

Unfortunately, the archives of the Telelogic DOORS forums are not complete. In this particular case, the thread extended onto a second page but the html file for the second page is missing from the archive. So I'm not sure if that second page may have revealed some important additional info. This is not isolated, I have come across a number of cases where subsequent pages of a thread are missing, or attachments in a thread are missing.

Paul Miller
Attachments

attachment_14437112_TelelogicDOORSForums-ConvertStringToFilt.zip

Re: Modify Filter
JL8713 - Fri Feb 19 07:21:55 EST 2010

Hi Paul,
I also recognized that the old forum has been removed.
But thanks a lot for the copy.

I made it running and after the first tests, it seems to work for our issues.
Regards
Randi

Re: Modify Filter
SystemAdmin - Fri Feb 19 07:29:40 EST 2010

JL8713 - Fri Feb 19 07:21:55 EST 2010
Hi Paul,
I also recognized that the old forum has been removed.
But thanks a lot for the copy.

I made it running and after the first tests, it seems to work for our issues.
Regards
Randi

Just noticed that the text descriptions of filters (DXL stringOf(module, filter)) has been
changed in the latest versions, e.g.

9.2 Column 'Object Level' contains '5' (case sensitive)
8.3 Column 'Object Level' contains "5" (case sensitive)

9.2 Attribute 'Object Text' contains 'test' (case sensitive)
8.3 Object Text Contains 'test'

If your solution parses that kind of descriptions it will not be version independent.

Re: Modify Filter
SteveK01 - Fri Mar 26 21:48:23 EDT 2010

SystemAdmin - Thu Feb 18 17:52:39 EST 2010
Checked to see if the FTP access to the archives of the Telelogic forums was still available, looks like it's been removed.

I have a copy and looked this up - the attached zip file has a PDF of the thread and a copy of the DXL files discussed in that thread. I hope you can make sense of it.

Unfortunately, the archives of the Telelogic DOORS forums are not complete. In this particular case, the thread extended onto a second page but the html file for the second page is missing from the archive. So I'm not sure if that second page may have revealed some important additional info. This is not isolated, I have come across a number of cases where subsequent pages of a thread are missing, or attachments in a thread are missing.

Paul Miller

Hi Paul,

I'm using this code(thanks BTW, I'd would have never figured this out!), but I'm having issues with the correct string format. Can you provide a sample of a filter string that correctly parses, please? I am using simple filters of the type Filter f = contains(attribute("Project"), "PCS4.6", true, false) and/or Filter f = attribute "Object Type" == "Req". Doing the stringOf(f) yields a nice string, but it fails to parse. I'm using v9.2.

Thanks in advance (have a nice weekend)

SteveK.

Re: Modify Filter
SystemAdmin - Wed Mar 31 08:03:10 EDT 2010

SteveK01 - Fri Mar 26 21:48:23 EDT 2010
Hi Paul,

I'm using this code(thanks BTW, I'd would have never figured this out!), but I'm having issues with the correct string format. Can you provide a sample of a filter string that correctly parses, please? I am using simple filters of the type Filter f = contains(attribute("Project"), "PCS4.6", true, false) and/or Filter f = attribute "Object Type" == "Req". Doing the stringOf(f) yields a nice string, but it fails to parse. I'm using v9.2.

Thanks in advance (have a nice weekend)

SteveK.

Anyone using this will have a lot of trouble in 9.2. Not much seems to have been broken in going from 8.2 to 9.2 but this is a notable exception (I have had to totally change some regular expressions). The attached code should cope with DOORS 9 and DOORS 8. I am assuming this new functionality was added for 9.2. I only have 9.2 on my system, let me know if this is not the case.

I have attached a use of the filterparser routine.
Note that this was originally a Reik Schroeder utility substantially revised by me.
If you change it or find a bug then please report it here.

Due to the rubbishness of this forum I am going to have to attach my code files in three messages.

Hope people find this of use, note I haven't tested this on DOORS 8, but was conscious of trying not to break it.

Best Regards,

Richard Good
Attachments

attachment_14451727_EditFilter.dxl

Re: Modify Filter
SystemAdmin - Wed Mar 31 08:05:53 EDT 2010

SystemAdmin - Wed Mar 31 08:03:10 EDT 2010
Anyone using this will have a lot of trouble in 9.2. Not much seems to have been broken in going from 8.2 to 9.2 but this is a notable exception (I have had to totally change some regular expressions). The attached code should cope with DOORS 9 and DOORS 8. I am assuming this new functionality was added for 9.2. I only have 9.2 on my system, let me know if this is not the case.

I have attached a use of the filterparser routine.
Note that this was originally a Reik Schroeder utility substantially revised by me.
If you change it or find a bug then please report it here.

Due to the rubbishness of this forum I am going to have to attach my code files in three messages.

Hope people find this of use, note I haven't tested this on DOORS 8, but was conscious of trying not to break it.

Best Regards,

Richard Good

File 2 - wish I'd used a zip now!
Attachments

attachment_14451730_FilterParserNewStyle.inc

Re: Modify Filter
SystemAdmin - Wed Mar 31 08:06:46 EDT 2010

SystemAdmin - Wed Mar 31 08:05:53 EDT 2010
File 2 - wish I'd used a zip now!

File 3
Attachments

attachment_14451731_VBRegexps.inc

Re: Modify Filter
PDU - Thu Apr 01 02:08:30 EDT 2010

SystemAdmin - Wed Mar 31 08:06:46 EDT 2010
File 3

Hi,

testeed on 8.3 and 9.1.

Works fine.

Pierre

Re: Modify Filter
SystemAdmin - Tue Nov 27 06:31:34 EST 2012

SystemAdmin - Fri Feb 19 07:29:40 EST 2010
Just noticed that the text descriptions of filters (DXL stringOf(module, filter)) has been
changed in the latest versions, e.g.

9.2 Column 'Object Level' contains '5' (case sensitive)
8.3 Column 'Object Level' contains "5" (case sensitive)

9.2 Attribute 'Object Text' contains 'test' (case sensitive)
8.3 Object Text Contains 'test'

If your solution parses that kind of descriptions it will not be version independent.

Is it possible to edit the already defined complex filters(through GUI) using scripts and then reapplying in module?

eg.I have predefined filter(big) which was defined in GUI.now i just need to change some characters in the defined filter and thats not possible through GUI. so is it possible to define the same filter using DXL with the required changes?

Re: Modify Filter
witthoft_carl - Mon Mar 27 10:31:37 EDT 2017

SystemAdmin - Wed Mar 31 08:06:46 EDT 2010
File 3

I have DOORS 9.6 , and dunno if that's why, but I'm losing most of my new filter string.   I am trying to apply a simple filter of the type    (a AND (b OR c) AND (d OR e)  AND (f OR g) )  ... but what's returned is only the last couple of bracketed pairs.   

 

I built a filter like this using the Advanced Filter tool, and the filter worked. I copied exactly that string and pasted it into your   dialog box window,  but   parseFilter returns the truncated string.     Any ideas?

Re: Modify Filter
witthoft_carl - Fri Apr 07 09:55:56 EDT 2017

witthoft_carl - Mon Mar 27 10:31:37 EDT 2017

I have DOORS 9.6 , and dunno if that's why, but I'm losing most of my new filter string.   I am trying to apply a simple filter of the type    (a AND (b OR c) AND (d OR e)  AND (f OR g) )  ... but what's returned is only the last couple of bracketed pairs.   

 

I built a filter like this using the Advanced Filter tool, and the filter worked. I copied exactly that string and pasted it into your   dialog box window,  but   parseFilter returns the truncated string.     Any ideas?

After some playing around, I think the problem is that the referenced macro gets "confused"  when travelling up and down nested parentheses.   The parsing logic needs upgrading :-( .    So I went semi-manual, creating a collection of simple filters and combining them with teh DXL - language syntax, then running a miniscript .   Example:

// copypaste next block into DXL edit window
string viewName = "CGWReview"
filtering off
// individual items first
Filter f429 = attribute "Object Number" < "4.2.9"  //ok
Filter f428 = attribute "Object Number" >= "4.2.8" //ok
Filter f416 = attribute "Object Number" < "4.1.6"  //ok
Filter f414 = attribute "Object Number" >= "4.1.4" //ok
Filter f412 = attribute "Object Number" < "4.1.2"  //ok
Filter f411 = attribute "Object Number" >= "4.1.1" //ok
Filter f423 = attribute "Object Number" < "4.2.3"  //ok
Filter f422 = attribute "Object Number" >= "4.2.2" //ok
Filter f4211 = attribute "Object Number" < "4.2.11"  //ok
Filter f4210 = attribute "Object Number" >= "4.2.10" //ok
Filter finfo = attribute "Objekttyp" == "Information"
// contains because here we search/regex a string 
Filter fcgw = contains(attribute "TopComment" , "CGW")
Filter fsa = attribute "Status_K" == "<agreed>" 
//includes/excludes rqd since multiple enums allowed 
Filter fid = includes(attribute "Discipline" ,"Mech")
// now combine
Filter fone = (f416 && f414) || (f412 && f411) || (f423 && f422)
Filter ftwo =  (fcgw && !fsa && !fid)
Filter f2ten = (f4211 &&f4210)
// set final combined filter
Filter foofilt = f2ten && !finfo  //(finfo ||(!fcgw && !fsa && fid) ) //fone && ftwo
set foofilt
filtering on 
// now write  
addFilter(  foofilt)
set( foofilt)
refresh current       // module...
save view viewName //last arg is viewname
// end of copypaste block